# coding=utf-8
# 全世界最帅的帅哥
from ysgg1_club_comment.utils.base_serializers import BaseListSerializer, BaseSerializer


class LabelSerializer(BaseSerializer):

    def to_dict(self):
        return {
            "id": self.data.id,
            "category_id": self.data.category_id,
            "labelName": self.data.label_name,
            "sortNum": self.data.sort_num
        }


class LabelListSerializer(BaseListSerializer):
    def to_dict(self):
        label_list = []
        for label in self.data_list:
            label_list.append({
                'id': label.id,
                "category_id": label.category_id,
                "labelName": label.label_name,
                "sortNum": label.sort_num
            })

        return label_list
